package com.diaosidadui.array;

public class Test02 {
    public static void main(String[] args) {
        int[] arr = {1, 2, 3, 4, 5, 6, 7};
        int max = arr[0];
        int min = arr[0];
        for (int i = 0; i < arr.length; i++) {
            //arr[i]
            if (max < arr[i]) {
                max = arr[i];
            }
        }
        System.out.println(max + "最大");
        for (int i = 0; i < arr.length; i++) {
            //arr[i]
            if (min > arr[i]) {
                min = arr[i];
            }
        }
        System.out.println(min + "最小");
    }
}
